<?php

require_once dirname(__FILE__) . './Classes/PHPExcel/IOFactory.php';
// include 'PHPExcel/IOFactory.php';
 


 $inputFileName = './example1.xls';

 echo 'Loading file ',pathinfo($inputFileName,PATHINFO_BASENAME),' using PHPExcel_Reader_Excel5<br />';
 $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);


echo '<hr />';

// $sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
// var_dump($sheetData);
 // $objPHPExcel = $objReader->load("test.xlsx");
$objWorksheet = $objPHPExcel->getActiveSheet();

echo '<table>' . "\n";
foreach ($objWorksheet->getRowIterator() as $row) {
  echo '<tr>' . "\n";
		
  $cellIterator = $row->getCellIterator();
  $cellIterator->setIterateOnlyExistingCells(false); // This loops all cells,
                                                     // even if it is not set.
                                                     // By default, only cells
                                                     // that are set will be
                                                     // iterated.
  foreach ($cellIterator as $cell) {
    echo '<td>' . $cell->getValue() . '</td>' . "\n";
  }
  
  echo '</tr>' . "\n";
}
echo '</table>' . "\n";
?>
